from os import path

import yaml

sourcefile = path.join("configuration.yaml")

with open(sourcefile, "r", encoding="utf-8") as f:
    loadjson = yaml.safe_load(f)
    devices = loadjson['devices']
    for item in devices.values():
        nameStr: str = item["friendly_name"]
        name = nameStr.split("/")[1]
        print(name)
